package com.itheima.hystrix.web;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class IntegralController {
    
    @Value("${server.port}")
    String port;
    
    @GetMapping("/integral")
    public String integral(@RequestParam String name) {
        System.out.println("开始调用积分服务...");
        // try {
        //     TimeUnit.MILLISECONDS.sleep(5000);
        // } catch (InterruptedException e) {
        //     e.printStackTrace();
        // }
        // int s= 1/0;
        return "积分服务调用成功 " + name + ",i am from port:" + port;
    }
    
}
